// 数字字体
@font-face {
	font-family: 'din';
	src: url('https://assets-1315727392.cos.ap-chongqing.myqcloud.com/applet/font/din_medium.otf');
}

.text-number {font-family: din}

// 字体数值大小
@for $i from 16 through 100 {
	@if ($i % 2 == 0) {
		.text-#{$i} {
			font-size: #{$i}rpx;
		}
	}
}

// 字体粗细
@for $i from 16 through 1000 {
	@if ($i % 100 == 0) {
		.font-weight-#{$i} {
			font-weight: $i;
		}
	}
}

// 文本对齐
$textAlign: left, center, right, justify;
@each $item in $textAlign {
	.text-#{$item} {
		text-align: $item;
	}
}

// 文本颜色
@each $key, $value in $colors {
	@for $i from 1 through 100 {
		@if ($i == 100) {
			.text-#{$key} {
				color: $value;
			}
		} @else if ($i%5 == 0) {
			.text-#{$key}-#{$i} {
				color: rgba($value, calc($i/100));
			}
		}
	}
}

// 文本装饰
$underline: (
	underline: underline,
	line-through: line-through,
	no-underline: none
);
@each $key, $value in $underline {
	.#{$key} {
		text-decoration: $value;
	}
}

// 多行文本超出隐藏
@for $i from 1 through 10 {
	.u-line-#{$i} {
		display: -webkit-box;
		overflow: hidden;
		text-overflow: ellipsis;
		word-wrap: break-word;
		white-space: normal !important;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: $i;
	}
}
